aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/[username]/(profile)/notes/+page.server.ts
blob: 4a8987980785efcf7a8aac0ceb014ccb7cecd22a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import { get } from "$lib/utils";
import { error } from "@sveltejs/kit";

export async function load({ parent }) {
  try {
    const { subject } = await parent();
    const events = await get(`/${subject.pubkey}/events`);
    return { events };
  } catch (e) {
    console.log(e);
    error(500, { message: "Failed to get events" });
  }
}